# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgname=starttls-mitm
pkgver=7.b257756
pkgrel=5
groups=('blackarch' 'blackarch-proxy' 'blackarch-sniffer' 'blackarch-networking')
pkgdesc='A mitm proxy that will transparently proxy and dump both plaintext and TLS traffic.'
arch=('any')
url='https://github.com/ipopov/starttls-mitm'
license=('APACHE')
depends=('python2')
makedepends=('git')
source=("git+https://github.com/ipopov/$pkgname.git")
sha512sums=('SKIP')

pkgver() {
  cd $pkgname

  echo $(git rev-list --count HEAD).$(git rev-parse --short HEAD)
}

prepare() {
  cd $pkgname

  sed -i 's/env python/env python2/' "mitm_listener.py"

  sed -i 's/.$//' "mitm_listener.py"
}

package() {
  cd $pkgname

  install -Dm 755 mitm_listener.py "$pkgdir/usr/bin/mitm_listener"
  install -Dm 644 -t "$pkgdir/usr/share/doc/$pkgname/" README
  install -Dm 644 LICENSE "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
}

